package com.qianfeng.ls.web;

import com.qianfeng.ls.entity.UserEntity;
import com.qianfeng.ls.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

    @Autowired
    IUserService userService;

    @RequestMapping("login")
    public String login(UserEntity userEntity, ModelMap map){

        //进行登录验证
        UserEntity login = userService.login(userEntity);

        System.out.println(login); //打印测试

        map.put("user",login);//放到前台jsp展示

        return "index";
    }

}
